<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@include file="/common/common.jsp"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<title>新闻 管理</title>
<link rel="stylesheet" href="../style/drp.css">
<script type="text/javascript" src="/script/public.js">

</script>
<script type="text/javascript">
	function ss(obj){
		window.location = '/news.action?size=${size}&typeId='+obj.value;
	}
	function aa(){
		var valSel = ${typeId};
		//var pages = parseInt
		document.getElementById("total").innerHTML = "&nbsp;共&nbsp"+Math.ceil(${pm.total}/15)+"&nbsp页";
		document.getElementById(valSel+"op").selected="selected";
		
	}
	
</script>
</head>

<body class="body1" onload="aa();">

	<form name="userform" id="userform">
		<div align="center">
			<table width="95%" border="0" cellspacing="0" cellpadding="0"
				height="35">
				<tr>
					<td class="p1" height="18" nowrap>&nbsp;</td>
				</tr>
				<tr>
					<td width="522" class="p1" height="17" nowrap><img
						src="../images/mark_arrow_02.gif" width="14" height="14">
						&nbsp; <b>新闻管理系统&gt;&gt;新闻类型维护</b></td>
				</tr>
			</table>
			<hr width="100%" align="center" size=0>
		</div>

		
		<table width="95%" height="20" border="0" align="center"
			cellspacing="0" class="rd1" id="toolbar">
			<tr>
				<td width="49%" class="rd19"><font color="#FFFFFF">查询列表</font>
				</td>
				<td width="27%" nowrap class="rd16">
					<div align="right">   	
					<select onchange="ss(this);"  id="sel">
					 <option name="0op" value="0" >全部</option>
	     	<c:forEach items="${list}" var="type1">
		    <option id="${type1.id}op" value="${type1.id}">${type1.name} </option>
		    </c:forEach>
		</select>  </div>
				</td>
			</tr>
		</table>
		<table width="95%" border="1" cellspacing="0" cellpadding="0"
			align="center" class="table1">
			<tr>
				<td width="55" class="rd6">序号</td>
				<td width="119" class="rd6">类型名称</td>
				<td width="152" class="rd6">标题</td>
				<td width="152" class="rd6">所属栏目</td>
				<td width="153" class="rd6">创建日期</td>
				<td width="153" class="rd6">操作</td>
			</tr>
			<c:if test="${empty pm}">
				<tr>
					<td colspan="7">没有找到相应的记录</td>
				</tr>
			</c:if>

			<c:if test="${!empty pm}">
				<c:forEach items="${pm.datas}" var="news">
					<tr>
						<td class="rd8">${news.id}</td>
						<td class="rd8">${news.type.name}</td>
						<td class="rd8">${news.title}</td>
						<td class="rd8">${news.type.name}</td>
						<td class="rd8"><fmt:formatDate value="${news.createTime}"
								type="date" /></td>
						<td class="rd8"><input name="btnDelete" class="button1"
							type="button" id="btnDelete" value="删除"
							onClick="del('/news!del.action?id=${news.id}','你确定要删除吗');">
							<input name="btnModify" class="button1" type="button"
							id="btnModify" value="修改"
							onClick="openWin('/news!updateInput.action?id=${news.id}','news',800,600,1);">
						</td>
					</tr>
				</c:forEach>
			</c:if>
		</table>
		
			
		<pg:pager url="/news.action" items="${pm.total }" export="currentPageNumber=pageNumber" maxPageItems="15">
			<pg:param name="size" value="15" />
		    <pg:param name="typeId" value="${typeId }" />
			<table width="95%" height="30" border="0" align="center"
				cellpadding="0" cellspacing="0" class="rd1">
				<tr>
					<td nowrap class="rd19" height="2">
						<div align="left">
							<font id="total" color="#FFFFFF">&nbsp;共&nbspxx&nbsp页</font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<font color="#FFFFFF">当前第</font>&nbsp
							<font color="#FF0000">	<pg:pages>
				<c:choose>
					<c:when test="${currentPageNumber eq pageNumber }">
						<font color="red">${pageNumber }</font>
					</c:when>
					
				</c:choose>
			</pg:pages></font>&nbsp
							<font color="#FFFFFF">页</font>
						</div>
					</td>
					<td nowrap class="rd19">
						<div align="right">
						
						<pg:first>
							<input name="btnTopPage" class="button1" type="button"
								id="btnTopPage" value="|&lt;&lt; " title="首页"
								onClick="window.location='${pageUrl}';">
								</pg:first>
								
								<pg:prev>
							<input name="btnPreviousPage" class="button1" type="button"
								id="btnPreviousPage" value=" &lt;  " title="上页"
								onClick="window.location='${pageUrl}';">
								</pg:prev>
								
								<pg:next>
				
			
							<input name="btnNextPage" class="button1" type="button"
								id="btnNextPage" value="  &gt; " title="下页" onClick="window.location='${pageUrl}';">
								</pg:next>
								
								<pg:last>
			
							<input name="btnBottomPage" class="button1" type="button"
								id="btnBottomPage" value=" &gt;&gt;|" title="尾页"
								onClick="window.location='${pageUrl}';">
								</pg:last>
								
								
							<input name="btnAdd" type="button" class="button1" id="btnAdd"
							value="添加"
							onClick="openWin('/news!addInput.action','news',800 , 600,1);">
						</div>
					</td>
				</tr>
			</table>
			
			
		
			
			
		
			
			
		</pg:pager>




		<p>&nbsp;</p>
	</form>
</body>
</html>
